package com.design.springboot.booksharing.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * REST 接口的请求结果的状态码
 *
 * @author admin
 */
@Getter
@AllArgsConstructor
public enum ApiResultCodeEnum {
    /**
     *
     */
    SUCCESS(200, "请求响应成功"),
    ERROR(9999, "请求响应失败"),

    ADD_ERROR(9810, "添加失败"),
    DELETE_ERROR(9820, "删除失败"),
    DELETE_NULL_ERROR(9821, "删除失败,数据不存在"),
    UPDATE_ERROR(9830, "更新失败"),
    SELECT_ERROR(9840, "查询失败"),

    UPLOAD_ERROR(9710, "上传失败"),
    DOWNLOAD_ERROR(9720, "下载失败"),

    /**
     * token 10**
     */
    TOKEN_NULL(1000, "请先登录"),

    /**
     * auth 11**
     */
    USERNAME_PATTERN_ERROR(1100, "用户名格式错误"),
    PASSWORD_ERROR(1101, "密码错误"),

    /**
     * user 12**
     */
    USER_NULL(1200, "用户不存在"),
    USER_PASSWORD_ERROR(1201, "密码错误"),

    /**
     * bookInfo 13**
     */
    BOOK_INFO_NULL(1300, "书籍信息不存在"),

    UN_ERROR(9999, "请求响应失败");

    private final Integer code;
    private final String message;
}
